 /* 
 * File:   cPositionedObject.cpp
 * Author: josep
 * 
 * Created on 11 / desembre / 2010, 21:42
 */

#include "cPositionedObject.h"

cPositionedObject::cPositionedObject() {
    SpeedX=0;
    SpeedY=0;
    ObjetctType=UNKNOWN_OBJECT_TYPE;
    TimeToRelease=1;
}

cPositionedObject::cPositionedObject(const cPositionedObject& orig) {
    this->PosX=orig.PosX;
    this->PosY=orig.PosY;
    this->Width=orig.Width;
    this->Height=orig.Height;
    this->SpeedX=orig.SpeedX;
    this->SpeedY=orig.SpeedY;
    ObjetctType=orig.ObjetctType;
    nom = orig.nom;
    TimeToRelease=orig.TimeToRelease;
}

cPositionedObject::~cPositionedObject() {
}

void cPositionedObject::SetPosY(float posY) {
    this->PosY = posY;
}


int cPositionedObject::GetPosY()  {
    return (int) PosY;
}

void cPositionedObject::SetPosX(float posX) {
    this->PosX = posX;
}

int cPositionedObject::GetPosX()  {
    return (int) PosX;
}

void cPositionedObject::Init(int PosX, int PosY, int Width, int Height){
    SetPosX(PosX);
    SetPosY(PosY);
    SetWidth(Width);
    SetHeight(Height);
}

void cPositionedObject::SetHeight(int Height) {
    this->Height = Height;
}
int cPositionedObject::GetHeight()  {
    return (int) Height;
}
void cPositionedObject::SetWidth(int Width) {
    this->Width = Width;
}
int cPositionedObject::GetWidth()  {
    return (int) Width;
}

void cPositionedObject::SetSpeedY(float speedY) {
    this->SpeedY = speedY;
}

float cPositionedObject::GetSpeedY()  {
    return SpeedY;
}

void cPositionedObject::SetSpeedX(float speedX) {
    this->SpeedX = speedX;
}

float cPositionedObject::GetSpeedX()  {
    return SpeedX;
}

c2DArea cPositionedObject::GetArea(){
    Area.Init(PosX, PosY, Width, Height, SpeedX, SpeedY);
    return (Area);
}
int cPositionedObject::GetObjetctType() const {
    return ObjetctType;
}
void cPositionedObject::SetNom(char* nom) {
    this->nom = nom;
}
char* cPositionedObject::GetNom() const {
    return nom;
}

bool cPositionedObject::hasNextTime(){
    return TimeToRelease>0;
}

void cPositionedObject::NoMoreTime(){
    TimeToRelease=0;
}

void cPositionedObject::NextStep(int time){
}





